'''中文字符频率统计。编写一个程序，对给定字符串中出现的全部字符（含中文字符）频率进行分析，采用降序方式输出。'''   
s = input('请输入任意字符串：')    #文本中不能由换行符，必须连续
frequency = {}
for letter in s:
    frequency[letter] = frequency.get(letter,0) +1
items = list(frequency.items())
items.sort(key=lambda x:x[1],reverse=True)
for i in range(len(frequency)):
    letter,Frequency = items[i]
    print('{0:<10}{1:>5}'.format(letter,Frequency))
